package io.renren.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.dao.UpdateDao;
import io.renren.entity.UpdateEntity;
import io.renren.service.UpdateService;
import io.renren.util.Query;
import org.springframework.stereotype.Service;

import java.util.Map;


@Service("updateService")
public class UpdateServiceImpl extends ServiceImpl<UpdateDao, UpdateEntity> implements UpdateService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<UpdateEntity> page = this.selectPage(
                new Query<UpdateEntity>(params).getPage(),
                new EntityWrapper<UpdateEntity>()
        );

        return new PageUtils(page);
    }



    @Override
    public boolean createNewUpdate(UpdateEntity UpdateEntity) {
        return this.insert(UpdateEntity);
    }


}
